package main

import "fmt"

func main() {

	// 只写管道
	var writeOnlyChan chan<- int
	writeOnlyChan = make(chan int, 2)
	writeOnlyChan <- 1
	writeOnlyChan <- 2

	// 只读管道
	var readOnlyChan <-chan int
	readOnlyChan = make(chan int, 2)
	num1 := <-readOnlyChan
	fmt.Println(num1)

}
